<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a="http://topnet.it/facelets"
	xmlns:fn="http://topnet.it/functions"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/WEB-INF/layout/t_single.xhtml">
	<ui:define name="title">Lista Contratti</ui:define>
	<ui:define name="content">
		<h2>Lista Contratti</h2>
		<h:form id="centerForm">

			<h:panelGrid columns="8">
				<h:panelGroup>
					<h:outputLabel id="nomeLabel1" value="Cerca per cognome:"
						for="nome1" />
					<h:inputText id="nome1"
						value="#{clientiController.search.obj.cognome}" size="15" />
				</h:panelGroup>
				<h:panelGroup>
					<h:outputLabel id="apertoLabel1" value="Aperto/Chiuso:"
						for="aperto1" />
					<h:selectOneMenu id="aperto1"
						value="#{contrattiController.search.obj.aperto}">
						<f:selectItems value="#{propertiesHandler.statusItems}" />
					</h:selectOneMenu>
				</h:panelGroup>
				<h:panelGroup>
					<h:outputLabel value="Num. Righe:" for="numRighe" />
					<h:selectOneMenu id="numRighe"
						value="#{contrattiController.rowsPerPage}">
						<f:selectItems value="#{propertiesHandler.rowItems}" />
					</h:selectOneMenu>
				</h:panelGroup>
				<h:commandButton value="cerca"
					action="#{contrattiController.refreshModel}" />
			</h:panelGrid>
			<rich:dataTable id="list" rows="#{contrattiController.rowsPerPage}"
				columnClasses="col" value="#{contrattiController.model}"
				var="contratto">
				<f:facet name="header">
					<h:outputText value="Lista Clienti" />
				</f:facet>
				<h:column>
					<f:facet name="header">
						<h:outputText value="cliente" />
					</f:facet>
					<h:outputText value="#{contratto.cliente.nomeCognome}" />
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="scooter" />
					</f:facet>
					<h:outputText value="#{contratto.scooter.marcaModello}" />
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Data Inizio" />
					</f:facet>
					<h:outputText value="#{contratto.dataInit}">
						<f:convertDateTime type="both" dateStyle="short" />
					</h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Data Prevista" />
					</f:facet>
					<h:outputText value="#{contratto.dataEnd}">
						<f:convertDateTime type="both" dateStyle="short" />
					</h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Data Riconsegna" />
					</f:facet>
					<h:outputText value="#{contratto.dataRiconsegna}">
						<f:convertDateTime type="both" dateStyle="short" />
					</h:outputText>
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Aperto" />
					</f:facet>
					<h:outputText id="si1" value="SI"
						rendered="#{contratto.aperto == true}" />
					<h:outputText id="no1" value="NO"
						rendered="#{contratto.aperto == false}" />
				</h:column>
				<h:column>
					<f:facet name="header">
						<h:outputText value="Aperto" />
					</f:facet>
					<h:commandLink action="#{contrattiController.detailContratto}"
						id="vedi" value="Vedi" />
				</h:column>

			</rich:dataTable>
			<div id="div" height="30" />
			<rich:dataScroller id="scollerList" for="list" maxPages="10"
				page="#{contrattiController.scrollerPage}" />
			<div height="30" />
			<h:commandLink id="addCliente"
				action="#{contrattiController.addContratto1}"
				value="Aggiungi Contratto" />
		</h:form>
	</ui:define>
</ui:composition>